﻿Public Class FormErreur

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Close()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim sTexte As String = ""
        For Each sLigne In Me.ListBox1.Items
            sTexte &= sLigne & vbCrLf
        Next
        My.Computer.Clipboard.Clear()
        My.Computer.Clipboard.SetText(sTexte)
    End Sub

    Public Sub Reset()
        Me.ListBox1.Items.Clear()
    End Sub

    Public Sub AjouteErreur(ByVal Chaine As String)
        Dim sListe() As String = Chaine.Split(vbCrLf)
        If sListe.Count > 0 Then
            For i As Integer = sListe.GetLowerBound(0) To sListe.GetUpperBound(0)
                If sListe(i).Trim <> "" Then Me.ListBox1.Items.Add(sListe(i).Trim())
            Next
        End If
    End Sub

    Public Sub ShowSiErreur()
        If Me.ListBox1.Items.Count > 0 Then
            Me.ShowDialog()
        End If
    End Sub
End Class